<template>
    <div class="box3">孙组件
     {{ user.name }}
    </div>
    </template>
    <script setup lang='ts'> 
     import {ref,reactive, inject} from 'vue';

     const user= inject<any>("user");
    </script>
    <style scoped lang='less'>
    .box3{
        width: 100%;
        height: 100px;
        background-color: skyblue;
    }
    </style>